package com.workshop.entity;

import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import java.io.Serializable;

import com.baomidou.mybatisplus.annotations.Version;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author chengluqiang
 * @since 2019-04-13
 */
@Data
@Accessors(chain = true)
public class SysUser extends Model<SysUser> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 微信登录获取的openid
     */
    private String openId;
    @TableField("parentId")
    private Integer parentId;
    /**
     * 账号
     */
    private String username;
    private String password;
    /**
     * 用户等级名称
     */
    private String nickname;
    /**
     * 头像url (不带域名前戳)
     */
    @TableField("headImgUrl")
    private String headImgUrl;
    /**
     * 手机
     */
    private String phone;
    /**
     * 对外服务电话
     */
    private String servicephone;
    private String email;
    /**
     * 生日
     */
    private Date birthday;
    /**
     * 0=女 1=男
     */
    private Integer sex;
    /**
     * 账号类型 0=超级管理员 1=总公司 2=分公司 3=业务员
     */
    private Integer type;
    /**
     * 数据字典表状态(userStatus) 0=无效 1=正常 2=锁定
     */
    private Integer status;
    /**
     * 管理员(公司)地址
     */
    private String address;
    /**
     * 关联地区表id 精确到城市
     */
    @TableField("areaId")
    private Integer areaId;
    private Date createTime;
    private Date updateTime;
    /**
     * 层级
     */
    private Integer level;
    /**
     * 层级解析 格式为'-id-id-'
     */
    private String levelparse;


    public static final String ID = "id";

    public static final String OPEN_ID = "open_id";

    public static final String PARENTID = "parentId";

    public static final String USERNAME = "username";

    public static final String PASSWORD = "password";

    public static final String NICKNAME = "nickname";

    public static final String HEADIMGURL = "headImgUrl";

    public static final String PHONE = "phone";

    public static final String SERVICEPHONE = "servicephone";

    public static final String EMAIL = "email";

    public static final String BIRTHDAY = "birthday";

    public static final String SEX = "sex";

    public static final String TYPE = "type";

    public static final String STATUS = "status";

    public static final String ADDRESS = "address";

    public static final String AREAID = "areaId";

    public static final String CREATE_TIME = "create_time";

    public static final String UPDATE_TIME = "update_time";

    public static final String LEVEL = "level";

    public static final String LEVELPARSE = "levelparse";

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
